<template>
  <div class="categorylist">
    <categoryitem
      v-for="(item, index) in categorylist"
      :key="index"
      :itemInfo="item"
      :leftmenuindex="leftmenuindex"
    />
  </div>
</template>

<script>
import categoryitem from "./Categoryitem.vue";
export default {
  name: "",
  data() {
    return {
      leftmenuindex: 0,
    };
  },
  components: {
    categoryitem,
  },
  computed: {
    categorylist() {
      return this.$store.getters.getcategorylist[this.leftmenuindex];
    },
  },
  mounted() {
    this.$bus.$on("leftitemclick", (index) => {
      this.leftmenuindex = index;
    });
  },
};
</script>

<style scoped>
.categorylist {
  display: flex;
  height: 100%;
  justify-content: space-evenly;
  /* 换行 */
  flex-wrap: wrap;
}
</style>